package org.czl.leetCode3;

import java.util.PriorityQueue;

public class l1845 {
    class SeatManager {
        PriorityQueue<Integer> stack = new PriorityQueue<>();

        public SeatManager(int n) {
            for(int i = 1; i <= n; i++){
                stack.add(i);
            }
        }

        public int reserve() {
            return stack.poll();
        }

        public void unreserve(int seatNumber) {
            stack.add(seatNumber);
        }
    }

}
